IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spm_SetSetting')
	BEGIN
		DROP  Procedure  spm_SetSetting
	END

GO

CREATE Procedure spm_SetSetting
(
	@Name varchar(100),
	@Value varchar(8000)
)
AS
	set nocount on
	UPDATE GlobalSettings SET [Value]=@Value WHERE [Name]=@Name
	if(@@ROWCOUNT=0)
	begin
		INSERT INTO GlobalSettings([Name],[Value]) VALUES (@Name,@Value)
	end
	set nocount off
	RETURN 0;
GO
 
